package com.spzx.product.api;

import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.common.core.web.page.TableDataInfo;
import com.spzx.product.api.domain.Brand;
import com.spzx.product.api.domain.vo.ProductSkuBrandVo;
import com.spzx.product.api.domain.vo.SkuDetailVo;
import com.spzx.product.api.domain.vo.SkuSearchVo;
import com.spzx.product.api.factory.RemoteSkuOrBrandFallbackFactory;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(value = ServiceNameConstants.PRODUCT_SERVICE, fallbackFactory = RemoteSkuOrBrandFallbackFactory.class)
public interface RemoteSkuOrBrandService {

    @Operation(summary = "内部调用接口:获取首页热门商品及一级分类列表")
    @GetMapping("sku/skuOrBrand")
    R<ProductSkuBrandVo> getSkuOrBrand();

    @Operation(summary = "内部调用接口:获取商品sku列表")
    @GetMapping("sku/skuList")
    R<TableDataInfo> getSkuList(@SpringQueryMap SkuSearchVo skuSearchVo);

    @GetMapping("brand/getBrandAll")
    @Operation(summary = "内部调用接口：查询分类品牌列表")
    R<List<Brand>> getBrandAll();

    @Operation(summary = "内部调用接口:获取商品sku详情")
    @GetMapping("sku/skuDetail/{skuId}")
    R<SkuDetailVo> getSkuDetail(@PathVariable("skuId") Long skuId);
}
